function pageInfo() {
  layui.use(['form', 'layer'], () => {
    let form = layui.form,
      layer = layui.layer;
    form.on('submit(login)', (data) => {
      let field = data.field;
      $.post('/admin/login', field, result => {
        if (result === 1) {
          layer.msg('登录中······');
          setTimeout(() => {
            window.location.href = '/admin/emp';
          }, 1000);
        } else {
          layer.msg('用户名或密码输入有误!');
        }
      });
    });
  });
}

pageInfo();